//
//  Yonghu.m
//  mc4-16
//
//  Created by mac on 16-4-17.
//  Copyright (c) 2016年 malatang. All rights reserved.
//

#import "Yonghu.h"

@implementation Yonghu
{
    NSString *QQ;
    NSString *passwd;
}
-(void)getName
{
    NSLog(@"请输入用户名：");
    char* no=malloc(40);
    scanf("%s",no);
    QQ=[[NSString alloc]initWithCString:no encoding:NSUTF8StringEncoding];
    [self getPasswd];
}

-(void)getPasswd
{
    NSLog(@"请输入密码：");
    char* pass=malloc(20);
    scanf("%s",pass);
    passwd=[[NSString alloc]initWithCString:pass encoding:NSUTF8StringEncoding];
    if ([QQ isEqualToString:@"1415641027"]&&[passwd isEqualToString:@"1245673"])
    {
        NSLog(@"登录成功。");
        [self.delegata loginWinthName:QQ passwd:passwd success:YES];
    }
    else
    {
        NSLog(@"登录失败。");
        [self.delegata loginWinthName:QQ passwd:passwd success:NO];
    }
}

@end
